add_library(add STATIC add.cu)

# CUDA_SEPARABLE_COMPILATION ON	允许 .cu 之间 __device__ 函数相互调用
# POSITION_INDEPENDENT_CODE ON	让 .a 适用于动态库或共享库
# CUDA_RESOLVE_DEVICE_SYMBOLS ON	解析 __device__ 符号，避免 undefined reference

set_property(TARGET add PROPERTY CUDA_SEPARABLE_COMPILATION ON)
set_property(TARGET add PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET add PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
